﻿using System;
using static CyberU;
using static CyberU.UI;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;

public class ClickTextSelectItem : ClickText, ISelectListItem
{
    public string direction { get; set; }

    public int _dataIndex;
    public int dataIndex
    {
        get { return _dataIndex; }
        set
        {
            lastDataIndex = _dataIndex;
            _dataIndex = value;
            // Delog($"a{lastChildIndex} {childIndex}");
        }
    }

    public int lastDataIndex { get; set; }

    public int _childIndex;

    public int childIndex
    {
        get
        {
            int ret = GetSiblingIndex(this);
            // Delog(ret);
            if (ret != _childIndex)
            {
                Delog("seem should not happen");
                lastChildIndex = _childIndex;
                _childIndex = ret;
            }

            return ret;
            // return _childIndex;
        }
        set
        {
            lastChildIndex = _childIndex;
            _childIndex = value;
        }
    }

    public int lastChildIndex { get; set; }

}